﻿namespace Skymate.Commands
{
    using Abp.Events.Bus;
    using Abp.Logging;

    using Skymate.Lyjt.Core;

    /// <summary>
    /// 联机查询命令
    /// </summary>
    public class QueryRequestOnlineCommand
        : BaseLightCommand
    {
        
        public QueryRequestOnlineCommand()
            :base(ProtocolConst.OptionType.QueryRequest,
                 ProtocolConst.ObjectType.Online)
        {
        }

        public override void ExecuteCommand(LightAppSession session, SemaphoreRequestInfo requestInfo)
        {
            var message = $"连机查询命令";
            LogHelper.Logger.Debug(message);
            
            EventBus.Default.Trigger(new QueryRequestOnlineEvent(
                session.RemoteEndPoint.ToString()));

            // 请求时间
            session.RequestDatetime();

        }
        
    }
}